﻿<%@ Page Title="Employee" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Form.aspx.cs" Inherits="HR_Web.Employees.Form" %>

<%@ Register Src="~/Controls/uclCompany.ascx" TagName="Company" TagPrefix="ucl" %>
<%@ Register Src="~/Controls/uclDepartment.ascx" TagName="Department" TagPrefix="ucl" %>
<%@ Register Src="~/Controls/uclDesignation.ascx" TagName="Designation" TagPrefix="ucl" %>
<%@ Register Src="~/Controls/uclEmploymentType.ascx" TagName="EmploymentType" TagPrefix="ucl" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $(".datepicker").datepicker({
                changeMonth: true,
                changeYear: true,
                showOn: "both",
                buttonImage: "../images/ico-cal.png",
                buttonImageOnly: true,
                showAnim: 'slideDown'
            });
        });
    </script>
    <script type="text/javascript">

        $("#anim").change(function () {
            $("#datepicker").datepicker("option", "showAnim", $(this).val());
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlEmpty" runat="server" Visible="false">
        <h1>
            No Employee Found</h1>
        <div>
            Sorry, no employee available with this ID.</div>
    </asp:Panel>
    <%--<asp:Panel ID="pnlItem" runat="server">
        <h1>
            <%# Eval("FirstName") %>
            <%# Eval("LastName") %>
        </h1>
        <div>
            <img id="Img1" alt="employee image" runat="server" src='' /></div>
        <div>
            <strong>Title:</strong>
            <%# Eval("Title") %><br />
            <strong>Title Of Courtesy:</strong>
            <%# Eval("TitleOfCourtesy") %><br />
            <strong>Date of Birth:</strong>
            <%# Eval("BirthDate", "{0:M-dd-yyyy}")%><br />
            <strong>Hire Date: </strong>
            <%# Eval("HireDate", "{0:M-dd-yyyy}")%><br />
            <hr />
            <strong>Country:</strong>
            <%# Eval("Country") %><br />
            <strong>Address: </strong>
            <%# Eval("Address") %><br />
            <strong>City: </strong>
            <%# Eval("City") %><br />
            <strong>Region</strong>
            <%# Eval("Region") %><br />
            <strong>Postal Code</strong>
            <%# Eval("PostalCode")%><br />
            <strong>Home Phone</strong>
            <%# Eval("HomePhone")%><br />
            <strong>Extension</strong>
            <%# Eval("Extension")%><br />
            <hr />
            <%# Eval("Notes") %>
            <hr />
        </div>
    </asp:Panel>--%>
    <asp:Panel ID="pnlEdit" runat="server">
        <div>
            <asp:FormView ID="formViewEmployee" runat="server" DefaultMode="Edit">
                <EmptyDataTemplate>
                    <h1 class="title-regular clearfix">
                        No Employee Found</h1>
                    <div class="notice">
                        Sorry, no employee available with this ID.</div>
                    <asp:Button ID="btnBack" CausesValidation="false" runat="server" Text="Back to listing page"
                        OnClick="ButtonGoToListPage_Click" SkinID="Button" />
                </EmptyDataTemplate>
                <EditItemTemplate>
                    <fieldset>
                        <legend>Employee Detail</legend>
                        <label>
                            First Name:</label>
                        <span class="required-field-indicator">*</span><br />
                        <asp:TextBox ID="txtFirstName" Text='<%# Bind("FirstName") %>' runat="server" CssClass="text"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ErrorMessage="Required"
                            CssClass="validator" ControlToValidate="txtFirstName" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <label>
                            Last Name:</label>
                        <span class="required-field-indicator">*</span><br />
                        <asp:TextBox ID="txtLastName" Text='<%# Bind("LastName") %>' runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Required"
                            CssClass="validator" ControlToValidate="txtLastName" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <label>
                            Office Id:</label><br />
                        <asp:TextBox ID="txtOfficeId" Text='<%# Bind("OfficeId") %>' runat="server" CssClass="text"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Required"
                            CssClass="validator" ControlToValidate="txtOfficeId" Display="Dynamic"></asp:RequiredFieldValidator><br />
                        <label>
                            Company:</label>
                        <span class="required-field-indicator">*</span><br />
                        <ucl:Company ID="uclCompany" runat="server" SelectedItemId='<%# Bind("CompanyId") %>' />
                        <br />
                        <label>
                            Department:</label>
                        <span class="required-field-indicator">*</span><br />
                        <ucl:Department ID="uclDepartment" runat="server"  SelectedItemId='<%# Bind("DepartmentId") %>' />
                        <br />
                        <label>
                            Designation:</label>
                        <span class="required-field-indicator">*</span><br />
                        <ucl:Designation ID="uclDesignation" runat="server"  SelectedItemId='<%# Bind("DesignationId") %>' />
                        <br />
                        <label>
                            Employment Type:</label>
                        <span class="required-field-indicator">*</span><br />
                        <ucl:EmploymentType ID="uclEmploymentType" runat="server"  SelectedItemId='<%# Bind("EmploymentTypeId") %>'  />
                        <br />
                        <label>
                            Date of Join:</label>
                        <span class="required-field-indicator">*</span><br />
                        <asp:TextBox ID="txtDateOfJoin" Text='<%# Bind("DateOfJoin", "{0:MM/dd/yyyy}") %>'
                            runat="server" CssClass="datepicker grid_5 text"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Required"
                            ControlToValidate="txtDateOfJoin" Display="Dynamic" CssClass="validator"></asp:RequiredFieldValidator>
                        <br />
                        <label>
                            Date of Confirmation:</label>
                        <br />
                        <asp:TextBox ID="txtDateOfConfirmation" Text='<%# Bind("DateOfConfirmation", "{0:MM/dd/yyyy}") %>'
                            runat="server" CssClass="datepicker grid_5 text"></asp:TextBox>
                        <br />
                        <label>
                            Employee in Service:</label>
                        <asp:CheckBox ID="CheckBox1" Text='<%# Bind("IsActive")%>' runat="server" />
                    </fieldset>
                    <fieldset>
                        <legend>Personal Detail</legend>
                        <label>
                            Date of Birth:</label>
                        <br />
                        <asp:TextBox ID="txtPersonalDetailDateOfBirth" Text='<%# Bind("PersonalDetail.DateOfBirth", "{0:MM/dd/yyyy}") %>'
                            runat="server" CssClass="datepicker grid_5 text"></asp:TextBox>
                        <br />
                        <label>
                            Gender:</label>
                        <br />
                        <asp:TextBox ID="txtPersonalDetailGender" Text='<%# Bind("PersonalDetail.Gender") %>'
                            runat="server" CssClass="textEntry"></asp:TextBox>
                        <br />
                        <label>
                            Marital Status:</label>
                        <br />
                        <asp:TextBox ID="txtPersonalDetailMaritalStatus" Text='<%# Bind("PersonalDetail.MaritalStatus") %>'
                            runat="server" CssClass="textEntry"></asp:TextBox>
                        <br />
                        <label>
                            Nationality:</label>
                        <br />
                        <asp:TextBox ID="txtPersonalDetailNationality" Text='<%# Bind("PersonalDetail.Nationality") %>'
                            runat="server" CssClass="textEntry"></asp:TextBox>
                        <br />
                    </fieldset>
                    <fieldset>
                        <legend>Contact Detail</legend>
                        <label>
                            Peresent Address:</label>
                        <br />
                        <asp:TextBox ID="txtContactDetailPeresentAddress" Text='<%# Bind("ContactDetail.PeresentAddress") %>'
                            runat="server" CssClass="textEntry" TextMode="MultiLine"></asp:TextBox>
                        <br />
                        <label>
                            Permanent Address:</label>
                        <br />
                        <asp:TextBox ID="txtContactDetailPermanentAddress" Text='<%# Bind("ContactDetail.PermanentAddress") %>'
                            runat="server" CssClass="textEntry" TextMode="MultiLine"></asp:TextBox>
                        <br />
                        <label>
                            Phone:</label>
                        <br />
                        <asp:TextBox ID="txtContactDetailPhone" Text='<%# Bind("ContactDetail.Phone") %>'
                            runat="server" CssClass="textEntry"></asp:TextBox>
                        <br />
                        <label>
                            Email:</label>
                        <br />
                        <asp:TextBox ID="txtContactDetailEmail" Text='<%# Bind("ContactDetail.Email") %>'
                            runat="server" CssClass="textEntry"></asp:TextBox>
                        <br />
                        <label>
                            Emergency Contact1:</label>
                        <br />
                        <asp:TextBox ID="txtContactDetailEmergencyContact1" Text='<%# Bind("ContactDetail.EmergencyContact1") %>'
                            runat="server" CssClass="textEntry"></asp:TextBox>
                        <br />
                        <label>
                            Emergency Contact2:</label>
                        <br />
                        <asp:TextBox ID="txtContactDetailEmergencyContact2" Text='<%# Bind("ContactDetail.EmergencyContact2") %>'
                            runat="server" CssClass="textEntry"></asp:TextBox>
                        <br />
                    </fieldset>
                </EditItemTemplate>
            </asp:FormView>
        </div>
        <div class="grid_9 inline omega">
            <p>
                <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="ButtonSave_Click" SkinID="Button" />
            </p>
            <em>Required fields are marked with <span class="required-field-indicator">*</span></em>
        </div>
    </asp:Panel>
    <%--  <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AllowPaging="True"
        AutoGenerateInsertButton="True" AutoGenerateRows="False" DataKeyNames="Id" DataSourceID="EntityDataSource1"
        DefaultMode="Insert" EmptyDataText="Empty">
        <Fields>
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
            <asp:BoundField DataField="OfficeId" HeaderText="OfficeId" SortExpression="OfficeId" />
            <asp:BoundField DataField="DateOfJoin" HeaderText="DateOfJoin" SortExpression="DateOfJoin" />
            <asp:BoundField DataField="DateOfConfirmation" HeaderText="DateOfConfirmation" SortExpression="DateOfConfirmation" />
            <asp:CheckBoxField DataField="IsActive" HeaderText="IsActive" SortExpression="IsActive" />
            <asp:BoundField DataField="DateOfResign" HeaderText="DateOfResign" SortExpression="DateOfResign" />
            <asp:TemplateField>
                <ItemTemplate>
                    <ucl:Company ID="uclCompany" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="CompanyId" HeaderText="CompanyId" SortExpression="CompanyId" />
            <asp:BoundField DataField="DepartmentId" HeaderText="DepartmentId" SortExpression="DepartmentId" />
            <asp:BoundField DataField="DesignationId" HeaderText="DesignationId" SortExpression="DesignationId" />
            <asp:BoundField DataField="EmploymentTypeId" HeaderText="EmploymentTypeId" SortExpression="EmploymentTypeId" />
            <asp:BoundField DataField="PersonalDetail.DateOfBirth" HeaderText="PersonalDetail.DateOfBirth"
                SortExpression="PersonalDetail.DateOfBirth" />
            <asp:BoundField DataField="PersonalDetail.Gender" HeaderText="PersonalDetail.Gender"
                SortExpression="PersonalDetail.Gender" />
            <asp:BoundField DataField="PersonalDetail.MaritalStatus" HeaderText="PersonalDetail.MaritalStatus"
                SortExpression="PersonalDetail.MaritalStatus" />
            <asp:BoundField DataField="PersonalDetail.Nationality" HeaderText="PersonalDetail.Nationality"
                SortExpression="PersonalDetail.Nationality" />
            <asp:BoundField DataField="ContactDetail.PeresentAddress" HeaderText="ContactDetail.PeresentAddress"
                SortExpression="ContactDetail.PeresentAddress" />
            <asp:BoundField DataField="ContactDetail.PermanentAddress" HeaderText="ContactDetail.PermanentAddress"
                SortExpression="ContactDetail.PermanentAddress" />
            <asp:BoundField DataField="ContactDetail.Phone" HeaderText="ContactDetail.Phone"
                SortExpression="ContactDetail.Phone" />
            <asp:BoundField DataField="ContactDetail.Email" HeaderText="ContactDetail.Email"
                SortExpression="ContactDetail.Email" />
            <asp:BoundField DataField="ContactDetail.EmergencyContact1" HeaderText="ContactDetail.EmergencyContact1"
                SortExpression="ContactDetail.EmergencyContact1" />
            <asp:BoundField DataField="ContactDetail.EmergencyContact2" HeaderText="ContactDetail.EmergencyContact2"
                SortExpression="ContactDetail.EmergencyContact2" />
            <asp:CommandField ShowEditButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=HRDBContext"
        DefaultContainerName="HRDBContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
        EntitySetName="Employees" EntityTypeFilter="Employee">
    </asp:EntityDataSource>--%>
</asp:Content>
